<?php
cload("object");
cload("database.dbquery");

/**
 * Функция по получению дополнительных данных для фильма
 * по номеру коллекции данных
 *
 * @author Di_Moon
 */
class addDataList {
    protected $_dbh;
    protected $_table;
    protected $_list;
    protected $_filmId;
    protected $_collId;
    
    function __construct($dbh, $filmId, $collId) {
        $this->_dbh = $dbh;
        $this->_table = "addData";
        
        $this->_filmId = $filmId;
        $this->_collId = $collId;
    }
    
    function getList() {
        $this->_list = array();
        $query = new dbquery($this->_dbh);
        $query->select()->from($this->_table)->where("collId='".$this->_collId."' and kinoid='".$this->_filmId."'");
        $sth = $this->_dbh->query($query);
        
        while($fa = $this->_dbh->raw_fetch_array()) {
            array_push($this->_list, new object($fa));
        }
        
        return $this->_list;
    }
}

?>
